package com.lagou.edu.util;

import java.util.Random;

public class RandomUtil {

    private static char[] cs = {
            '0','1','2','3','4','5','6','7','8','9'
    };
    public static String randomString(int length){
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < length; i++) {
            sb.append(cs[new Random().nextInt(cs.length)]);
        }
        return sb.toString();
    }

    public static void main(String[] args) {
        for (int i = 0; i < 10; i++) {
            System.out.println(randomString(6));
        }
    }
}
